#pragma once
#include <iostream>
#include <memory>
namespace ns_protocol
{
    class Request
    {
    public:
        Request() : _data_x(0), _data_y(0), _oper(0)
        {
        }
        Request(int x, int y, char op) : _data_x(x), _data_y(y), _oper(op)
        {
        }
        void Debug()
        {
            std::cout << "_data_x: " << _data_x << std::endl;
            std::cout << "oper" << _oper << std::endl;
            std::cout << "_data_y " << _data_y << std::endl;
        }
        void Inc()
        {
            _data_x++;
            _data_y++;
        }

    public:
        int _data_x; // 第一个操作数
        int _data_y; // 第二个操作数
        char _oper;  // 操作符
    };

    class Response
    {
    public:
        Response(): _result(0), _code(0)
        {
        }
        Response(int result, int code): _result(result), _code(code)
        {
        }

    public:
        int _result;
        int _code;
    };
    class Factor
    {
    public:
        std::shared_ptr<Request> BuildResquest()
        {
            std::shared_ptr<Request> req = std::make_shared<Request>();
            return req;
        }
        std::shared_ptr<Request> BuildResquest(int x, int y,int oper)
        {
            std::shared_ptr<Request> req = std::make_shared<Request>(x,y,oper);
            return req;
        }

        std::shared_ptr<Response> BuildReponse()
        {
            std::shared_ptr<Response> resp = std::make_shared<Response>();
            return resp;
        }
        std::shared_ptr<Response> BuildReponse(int result, int code)
        {
            std::shared_ptr<Response> resp = std::make_shared<Response>(result,code);
            return resp;
        }
    };

}
